package cn.sightsnow.zh;

import cn.sightsnow.zh.entity.Location;
import cn.sightsnow.zh.entity.Route;
import cn.sightsnow.zh.entity.Target;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.rest.core.config.RepositoryRestConfiguration;
import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer;
import org.springframework.web.servlet.config.annotation.CorsRegistry;

@Configuration
public class SpringDataRestCustomization implements RepositoryRestConfigurer {
    @Override
    public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config, CorsRegistry cors) {
        config.exposeIdsFor(Location.class);
        config.exposeIdsFor(Route.class);
        config.exposeIdsFor(Target.class);
    }
}